import { hot } from 'react-hot-loader/root';
import React from 'react'
import { render } from 'react-dom'
import { Provider } from 'react-redux'
import { HashRouter, BrowserRouter as Router, Route, Switch } from 'react-router-dom'
import routes from './router'
import store from './store'
import Layout from '@/components/layout'
import './styles/common.scss'
const App = () => <Provider store={store}>
    <HashRouter>
        <Layout>
            <Switch>
                {routes.map((route, index) => (
                    <Route
                        key={index}
                        path={route.path}
                        exact={route.exact}
                        component={route.component} />
                ))}
            </Switch>
        </Layout>
    </HashRouter>
</Provider>
render(
    <App />,
    document.getElementById('app')
)
hot(App);
